<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>

  <script>
    class Person {
      name = "";
      #food = "";
      sex = "";

      constructor(name, food, sex) {
        this.name = name;
        this.#food = food;
        this.sex = sex;
      }

      getSex() {
        return this.sex;
      }

      setSex(sex) {
        this.sex = sex;
      }

      getName() {
        return this.name;
      }

      setName(name) {
        this.name = name;
      }

      getFood() {
        return this.food;
      }

      setFood() {
        this.food = food;
      }
    }

    class Son extends Person {
      #id = "";
      constructor(name, sex, food, id) {
        super(name, food, sex);
        this.#id = id;
      }

      getId() {
        return this.id;
      }

      setId(id) {
        this.#id = id;
      }
    }

    const son = new Son('tom', 'man', 'food', '001');

    console.log(son);
  </script>
</body>

</html>